import Vue from 'vue';
import showList from './showList.vue'

const showListConstructor = Vue.extend(showList)

function showAllList(_t,_d=2000){
    const listDom = new showListConstructor({
        el:document.createElement('div'),
        data:function(){
            return{
                txt:_t,
                show:true
            }
        }
    })
    document.body.appendChild(listDom.$el)
    setTimeout(() => {
        listDom.show = false
    }, _d);
}

function showListReg(){
    Vue.prototype.$showList = showAllList
}

export default showListReg